﻿using KinonekoSoftware.CodariaDB.Documents.Theories.Elements;
using KinonekoSoftware.CodariaDB.Documents.Theories.Rarities;

namespace KinonekoSoftware.CodariaDB.Documents.TemplateContents.Abilities
{
    public sealed class TemplatedAbilityContent : TemplatedContent
    {
        private Rarity  _rarity;
        private Element _element;
        
        public string Avatar         { get; set; }
        public string RarityID       { get; set; }
        public string ElementID      { get; set; }
        public bool   IsUltimate     { get; set; }
        public bool   IsRarityHidden { get; set; }
        
        

        public required List<ColoredKeyword>    Keywords     { get; set; }
        public required List<ColoredVocabulary> Vocabularies { get; set; }
        public override TemplatedContentType    Type         => TemplatedContentType.Ability;


        [BsonIgnore]
        public Rarity Rarity
        {
            get => _rarity;
            set
            {
                
                _rarity   = value;
                RarityID = _rarity?.Id;
                RaiseUpdated();
            }
        }

        [BsonIgnore]
        public Element Element
        {
            get => _element;
            set
            {
                _element  = value;
                ElementID = _element?.Id;
                RaiseUpdated();
            }
        }
    }
}